<div class="test-center"></div>
<style>
    .test-center{
        border: 1px solid #ccc;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate( -50%, -50% );
    }
 </style>